class Point {
  
  PVector startPoint;
  PVector currentPoint;
  
  PVector endPoint;
  
  //the size of the point
  float r = 10;
  
  float velocity = 1;
  
  Point (PVector newStartPoint){
    startPoint = newStartPoint;
    currentPoint = new PVector (newStartPoint.x, newStartPoint.y);
  }
  
  void setEndPoint(PVector newEndPoint){
    endPoint = newEndPoint;
  }
  
  
  boolean goaldReached(){
    boolean result = false;
    
    PVector temp = PVector.sub(endPoint, currentPoint);
    
    if(temp.mag()<=0.5){
      //alcancé mi objetivo, entonces retorno true.
      result = true;
    }
    
    return result;
    
  }
  
  PVector getStartPoint(){
    return startPoint;
  }
  
  void draw(){
    
    fill(0);
    
    PVector temp = PVector.sub(endPoint, currentPoint);
    
    temp.normalize();
    
    temp.mult(velocity);
    
    currentPoint.add(temp);
    
    ellipse(currentPoint.x, currentPoint.y, r, r);
    
  }
  
}
